﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>提交线报建议得奖励</title>
    <link href="https://cdn.bootcdn.net/ajax/libs/weui/2.3.0/style/weui.min.css" rel="stylesheet">
    <link href="~/Content/css/weuix.css" rel="stylesheet" />
    <link href="~/Content/huiji.css" rel="stylesheet" />
</head>
<body>

    <div class="container">

        <div class="page-hd">
            <h1 class="page-hd-title">
                提交线报和建议得话费(1-10元)或随机礼品，感谢您的支持，为了奖励的快速发放请留下真实的联系的方式
            </h1>
            <p class="page-hd-desc"></p>
        </div>
        <div class="weui-cells__title">信息</div>
        <form onsubmit="return false" action="##" method="post" id="form1">
            <div class="weui-cells weui-cells_form">
                <div class="weui-cell weui-cell_select">
                    <div class="weui-cell__bd">
                        <select class="weui-select" name="Type">
                            <option selected="" value="1">线报</option>
                            <option value="2">建议</option>
                        </select>
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd">
                        <label class="weui-label">昵称</label>
                    </div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" placeholder="请输入姓名或昵称" type="text" name="Name" maxlength="50">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd">
                        <label class="weui-label">手机号</label>
                    </div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" placeholder="请输入手机号,最好是微信号" type="tel" name="Phone" maxlength="11">
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd">
                        <label class="weui-label">邮箱</label>
                    </div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" placeholder="请输入邮箱" type="email" name="Email" maxlength="300">
                    </div>

                </div>
                <div class="weui-cell">
                    <div class="weui-cell__bd">
                        <textarea class="weui-textarea" placeholder="请输入您想提交的信息，填写的请尽量具体，方便更快的核对和发放奖励，想要的奖励，话费，随机礼品，随机礼品请备注上收货地址" rows="3" name="TContent" maxlength="5000"></textarea>
                        <div class="weui-textarea-counter"><span>0</span>/<i>500</i></div>
                    </div>
                </div>
                <div class="weui-cell">
                    <div class="weui-cell__hd">
                        <label class="weui-label">链接</label>
                    </div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" placeholder="关联的活动链接" type="text" name="To_Link" maxlength="5000">
                    </div>
                </div>
                <div class="weui-cell weui-cell_vcode">
                    <div class="weui-cell__hd"><label class="weui-label">验证码</label></div>
                    <div class="weui-cell__bd">
                        <input class="weui-input" placeholder="请输入验证码" type="text" id="captcha" name="captcha" maxlength="4">
                    </div>
                    <div class="weui-cell__ft">
                        <img id="code" class="weui-vcode-img" src="/mobile/GetSubmitCode?default" width="130" height="53" onclick="getcode();">
                    </div>
                </div>
                <div class="weui-btn-area">
                    <a class="weui-btn weui-btn_primary" href="javascript:" id="btn">提交</a>
                </div>
                <br />
                <br />
                <br />
            </div>
        </form>
        <div class="weui-footer weui-footer_fixed-bottom">
            <p class="weui-footer__links">
                <a href="/mobile/index" class="weui-footer__link">首页</a>
                <a href="javascript:history.go(-1)" class="weui-footer__link">返回</a>
            </p>
            <p class="weui-footer__text">Copyright © 2020-2020 HuiJi</p>
        </div>
    </div>

    <script src="https://cdn.bootcdn.net/ajax/libs/zepto/1.2.0/zepto.js"></script>
    <script src="~/Scripts/zepto.weui.js"></script>
    <script src="~/Scripts/huiji.js"></script>
    <script>
        function getcode() {
            //$("#code").src = '/mobile/GetSubmitCode?' + Math.random()
            document.getElementById("code").src = "/mobile/GetSubmitCode?r=" + Math.random();
        }

        $("#btn").click(function () {

            //var captcha = $("#captcha").val();

            var data = $('#form1').serialize();
            $.ajax({
                type: "POST",
                url: '../Mobile/AjaxSubmitTip',
                data: data,
                dataType: "json",
                beforeSend: function () {

                },
                success: function (rs) {
                    console.log(rs);
                    if (rs.state == "success") {
                        $.alert(rs.message, "信息", function () {
                            history.go(-1);
                        });
                    } else {
                        $.toptip(rs.message, 2000);
                    }
                },
                timeout: 15000
            });
        });
    </script>
</body>
</html>
